package com.lihao.sam.controller;

import com.lihao.sam.entity.ScoreSet;
import com.lihao.sam.entity.ScoreStatistics;
import com.lihao.sam.service.intf.ScoreSetService;
import com.lihao.sam.service.intf.ScoreStatisticsService;
import com.lihao.sam.vo.PageVo;
import com.lihao.sam.vo.R;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author 赵申奥
 * @Description:学生分数统计
 */
@RestController
@RequestMapping("/api/statistics/")
public class ScoreStatisticsController {
    @Resource
    private ScoreStatisticsService service;

    @PostMapping("add.do")
    public R add(ScoreStatistics scoreStatistics){
        return service.add(scoreStatistics);
    }
    @PostMapping("update.do")
    public R update(ScoreStatistics scoreStatistics){
        return service.update(scoreStatistics);
    }
    @PostMapping("del.do")
    public R del(int id){
        return service.delete(id);
    }
    @GetMapping("page.do")
    public PageVo page(String sno, String name, String address,int page, int limit){
        return service.queryPage(sno,name,address,page, limit);
    }

}
